From: Florian Müllner Date: Tue, 21 Oct 2025 18:12:59 +0000 (+0200) Subject: tools: Symlink node_modules in project root X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~153 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=11a5aad53e2b462d7cac70b26515d9b7f4bb0466;p=gnome-shell.git tools: Symlink node_modules in project root NPM assumes quite strongly that it manages the project as a whole and its package/lock files are located in the project root. While we somehow managed to keep the npm tooling in a subfolder, this comes at the cost of breaking imports of additional modules. This will become relevant when we update eslint to a supported version, as we want to keep using the `junit` formatter in CI, which has now been split out into a separate module. So bite the bullet and make the node_modules folder available in the project root. On the plus side, having the node_modules folder in the project root allows language servers in IDEs/editors to pick it up. Part-of: --- diff --git a/tools/run-eslint.sh b/tools/run-eslint.sh index b3c975632..bf3bc8817 100755 --- a/tools/run-eslint.sh +++ b/tools/run-eslint.sh @@ -3,6 +3,10 @@ # SPDX-FileCopyrightText: 2020 Philip Chimento # SPDX-FileCopyrightText: 2025 Florian Müllner -cd $(dirname -- "$0") +srcdir=$(dirname -- "$0") + +cd $srcdir [ ! -d node_modules ] && npm clean-install +# Link in project root to make imports work properly +[ ! -e ../node_modules ] && ln -s $srcdir/node_modules ../node_modules npm run lint -- "$@"